from twisted.internet.serialport import SerialPort 
from twisted.internet import reactor

class eDIP43A_Driver(SerialPort):

    def __init__(self, factory, *args, **kwargs):
        ''' Setup the client and start listening on the serial port

        :param factory: The factory to build clients with
        '''
        protocol = factory.buildProtocol(None)
               
        
        #IReactorTime.callLater and Deferred are mixed together by twisted.internet.task.deferLater.
        
        #from twisted.internet import reactor, task
        
        #d = task.deferLater(reactor, 0, myFunction, parameter1)
        #d.addCallback(lambda ignored: reactor.stop())
        #reactor.run()


        
        
        
        
        SerialPort.__init__(self, protocol, *args, **kwargs)